
if exists(select name from sysobjects where name = 'sp_TinDeleteByXml')
	drop proc sp_TinDeleteByXml
go
/*
	Created by: Phuoc NH
	Created on: 18/01/2013 (dd/mm/yyyy)
	Description: delete tin by xml
	--
	File:$sql-scripts/Proc.sp_TinDeleteByXml.sql
*/

create proc sp_TinDeleteByXml
@Doc xml
as
begin
	update tbl_Tin set Status=0 where Tin_id in ( select a.value('@Tin_id','int') from @Doc.nodes('Tin') r(a))
	update tbl_Tin set Status=0 where Tin_cha_id in(select a.value('@Tin_id','int') from @Doc.nodes('Tin') r(a))
end
go